<!-- 初始化模版页面 -->
<template>
    <view class="userInfoClass">
        <Navbar title="个人信息"> </Navbar>
        <view class="p-20rpx">
            <view class="w-full box">
                <view
                    class="h-103rpx lh-103rpx w-full pl-20rpx fw-600 fw-600 b-b border-hex-E6E6E6"
                    >基础资料</view
                >
                <van-field
                    left-icon="manager-o"
                    v-model="userName"
                    label="用户昵称"
                    readonly
                />
                <van-field
                    left-icon="phone-o"
                    v-model="phonenumber"
                    label="手机号码"
                    readonly
                />
                <van-field
                    left-icon="envelop-o"
                    v-model="email"
                    label="用户邮箱"
                    readonly
                />
                <van-field
                    left-icon="cluster-o"
                    v-model="dep"
                    label="所属部门"
                    readonly
                />
                <van-field
                    left-icon="friends-o"
                    v-model="roleGroup"
                    label="所属角色"
                    readonly
                />
                <van-field
                    left-icon="clock-o"
                    v-model="createTime"
                    label="创建日期"
                    readonly
                />
            </view>
        </view>
    </view>
</template>
<script>
import { defineComponent, reactive, toRefs, onMounted } from 'vue'
export default defineComponent({
    props: {},
    setup(props, { emit }) {
        const state = reactive({
            userName: null,
            phonenumber: null,
            email: null,
            dep: null,
            roleGroup: null,
            createTime: null,
        })
        const methods = {}
        const apis = {}
        const computeds = {}
        onLoad((options) => {
            if (options) {
                let paramCode = JSON.parse(options.profileObj)
                state.userName = paramCode.data.createBy
                state.phonenumber = paramCode.data.phonenumber
                state.email = paramCode.data.email
                state.dep = paramCode.roleGroup + '/' + paramCode.postGroup
                state.roleGroup = paramCode.roleGroup
                state.createTime = paramCode.data.createTime
            }
        })
        onMounted(() => {})
        return {
            ...apis,
            ...toRefs(state),
            ...methods,
            ...computeds,
        }
    },
})
</script>
<style lang="less" scoped></style>
